<!DOCTYPE HTML>
    <html>

    <head>
        <meta charset="utf-8">
        <meta name="renderer" content="webkit|ie-comp|ie-stand">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
        <meta http-equiv="Cache-Control" content="no-siteapp" />
        <link rel="Bookmark" href="/favicon.ico">
        <link rel="Shortcut Icon" href="/favicon.ico" />
        <!--[if lt IE 9]>
        <script type="text/javascript" src="/admin/lib/html5shiv.js"></script>
        <script type="text/javascript" src="/admin/lib/respond.min.js"></script>
        <![endif]-->
        <link rel="stylesheet" type="text/css" href="/admin/static/h-ui/css/H-ui.min.css" />
        <link rel="stylesheet" type="text/css" href="/admin/static/h-ui.admin/css/H-ui.admin.css" />
        <link rel="stylesheet" type="text/css" href="/admin/lib/Hui-iconfont/1.0.8/iconfont.css" />
        <link rel="stylesheet" type="text/css" href="/admin/static/h-ui.admin/skin/default/skin.css" id="skin" />
        <link rel="stylesheet" type="text/css" href="/admin/static/h-ui.admin/css/style.css" />
        <!--[if IE 6]>
        <script type="text/javascript" src="/admin/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
        <script>DD_belatedPNG.fix('*');</script>
        <![endif]-->
        <title>商品评论列表</title>
    </head>

    <body>
        <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 商品评论管理 <span class="c-gray en">&gt;</span> 商品评论列表 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a></nav>
        <div class="page-container">
            <form class="Huiform" method="post" action="/admin/user_item_comment/search" target="_self">
                <input type="hidden" name="_token" value="{{csrf_token()}}">
                <div class="text-c"> 日期范围：
                    <input type="text" onfocus="WdatePicker({ maxDate:'#F{$dp.$D(\'datemax\')||\'%y-%M-%d\'}' })" id="datemin" name="datemin" class="input-text Wdate" style="width:120px;"> -
                    <input type="text" onfocus="WdatePicker({ minDate:'#F{$dp.$D(\'datemin\')}',maxDate:'%y-%M-%d' })" id="datemax" name="datemax" class="input-text Wdate" style="width:120px;">
                    <input type="text" class="input-text" style="width:250px" placeholder="输入商品评论内容" id="" name="key">
                    <button type="submit" class="btn btn-success" id="" name=""><i class="Hui-iconfont">&#xe665;</i> 搜评论内容</button>
                </div>
            </form>
            <div class="cl pd-5 bg-1 bk-gray mt-20"> <span class="l"><a href="javascript:;" onclick="datadel()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a> </span> <span class="r">共有数据：<strong>{{count($data)}}</strong> 条</span> </div>
            <table class="table table-border">
                <thead>
                    <tr>
                        <th scope="col" colspan="10">商品评论列表</th>
                    </tr>
                </thead>
                <tbody>
                	@foreach($data as $val)
                    <tr class="text-c">
                        <td>
                            <div class="text-l">商品名称：{{$val -> item_name}}</div>
                            <div class="text-l mb-20">
                                商品主图：
                                @if(!empty($val -> cover_img))
                                    <img src="{{$val -> cover_img}}" width="100" data-toggle="popover" data-html="true"  data-content="<img src='{{$val -> cover_img}}' width='350'>" data-placement="right" alt="">
                                @endif
                            </div>
                            @if($val -> rel_comment -> count())
                            <table class="table-bordered table-bg">
                                <tr>
                                    <th width="5%">ID</th>
                                    <th width="10%">用户</th>
                                    <th width="75%">评论内容</th>
                                    <th width="10%">评论时间</th>
                                </tr>
                                @foreach($val -> rel_comment as $comm_val)
                                    <tr>
                                        <td>{{$comm_val -> id}}</td>
                                        <td>
                                            <a data-title="用户信息" data-href="/admin/user/detail?uid={{$comm_val -> rel_user -> id}}" onclick="Hui_admin_tab(this)" href="javascript:void(0);">
                                                <div><img src="{{$comm_val -> rel_user -> avatar}}" alt="" class="round"></div>
                                                <div>{{$comm_val -> rel_user -> username}}</div>

                                            </a>
                                        </td>
                                        <td class="text-l">
                                            <div>
                                                {{$comm_val -> content}}
                                                <a title="编辑" href="javascript:;" onclick="classification_edit('商品评论编辑','/admin/user_item_comment/edit','{{$val -> id}}','800','500')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6df;</i></a>
                                            </div>
                                            <div>
                                                @if($comm_val -> rel_commentImg != null)
                                                    <?php
                                                    $img_array = explode(',',$comm_val -> rel_commentImg -> img);
                                                        foreach($img_array as $img_val){
                                                            echo "<img src='$img_val' alt='' class='thumbnail' style='width: 100px;'>";
                                                        }
                                                    ?>
                                                @endif
                                            </div>

                                        </td>
                                        <td>{{$comm_val -> created_at}}</td>
                                    </tr>
                                @endforeach
                            </table>
                            @endif
                        </td>
                    </tr>
                    @endforeach
                </tbody>
            </table>
        </div>
        <!--_footer 作为公共模版分离出去-->
        <script type="text/javascript" src="/admin/lib/jquery/1.9.1/jquery.min.js"></script>
        <script type="text/javascript" src="/admin/lib/layer/2.4/layer.js"></script>
        <script type="text/javascript" src="/admin/static/h-ui/js/H-ui.min.js"></script>
        <script type="text/javascript" src="/admin/static/h-ui.admin/js/H-ui.admin.js"></script>
        <!--/_footer 作为公共模版分离出去-->
        <!--请在下方写此页面业务相关的脚本-->
        <script type="text/javascript" src="/admin/lib/My97DatePicker/4.8/WdatePicker.js"></script>
        <script type="text/javascript" src="/admin/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
        <script type="text/javascript" src="/admin/lib/laypage/1.2/laypage.js"></script>
        <script type="text/javascript">

        //使用datatables
        $(function(){
        	//实例化datatables
        	$('table').dataTable({
        		//配置项
        		//禁止指定列的排序操作
        		"columnDefs": [
				    { "orderable": false, "targets": [0]}
				    //{ "orderData": [ 0, 8 ] },
				],
				//初始化默认排序字段
				"order": [[1,'asc']]
        	});
            $("[data-toggle='popover']").popover();
        });
        </script>
    </body>

    </html>